package com.java.service.impl;

import com.java.entity.Link;
import com.java.mapper.LinkMapper;
import com.java.service.LinkService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 友情链接Service实现类接口
 * @author Administrator
 *
 */
@Service("linkService")
public class LinkServiceImpl implements LinkService {

    @Resource
    private LinkMapper linkMapper;
    @Override
    public List<Link> getLink(Map<String, Object> map) {
        List<Link> linkList = linkMapper.getLink(map);
        linkList = linkList.stream().sorted(Comparator.comparingInt(Link::getOrderNo)).collect(Collectors.toList());
        return linkList;
    }
}
